package com.mzj.saas.mservice.house.entity;

import com.mzj.saas.mservice.property.entity.CommunityHouseUser;
import lombok.Data;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 公租房表
 */
@Entity
@Table(name = "saas_house")
@Data
public class House {

    @Id
    @Basic
    @Column(name = "id", nullable = true)
    private String id; //

    @Basic
    @Column(name = "org_id", nullable = true)
    private Long orgId; // 组织id

    @Basic
    @Column(name = "province_id", nullable = true)
    private Long provinceId; // 省

    @Basic
    @Column(name = "city_id", nullable = true)
    private Long cityId; // 市

    @Basic
    @Column(name = "district_id", nullable = true)
    private Long districtId; // 区

    @Basic
    @Column(name = "street_id", nullable = true)
    private Long streetId; // 街道

    @Basic
    @Column(name = "community_id", nullable = true)
    private Long communityId; // 社区

    @Basic
    @Column(name = "address", nullable = true)
    private String address; // 地址

    @Basic
    @Column(name = "residence_community_id", nullable = true)
    private String residenceCommunityId; // 小区id

    @Basic
    @Column(name = "residence_community_name", nullable = true)
    private String residenceCommunityName; // 小区名称

    @Basic
    @Column(name = "building_num", nullable = true)
    private Long buildingNum; // 楼栋

    @Basic
    @Column(name = "unit", nullable = true)
    private Long unit; // 单元

    @Basic
    @Column(name = "room_number", nullable = true)
    private String roomNumber; // 房号

    @Basic
    @Column(name = "floor", nullable = true)
    private Integer floor; // 楼层

    @Basic
    @Column(name = "area", nullable = true)
    private BigDecimal area; // 面积

    @Basic
    @Column(name = "room", nullable = true)
    private Integer room; // 室

    @Basic
    @Column(name = "hall", nullable = true)
    private Integer hall; // 厅

    @Basic
    @Column(name = "toilet", nullable = true)
    private Integer toilet; // 卫

    @Basic
    @Column(name = "house_nature", nullable = true)
    private Integer houseNature; // 房屋性质:1.自住房;2.出租房;3.保障性住房

    @Basic
    @Column(name = "house_property_id", nullable = true)
    private Long housePropertyId; // 所属物业

    @Basic
    @Column(name = "audit_status", nullable = true)
    private Integer auditStatus; // 房源审核状态:0未审核 1已审核

    @Basic
    @Column(name = "bind_status", nullable = true)
    private Integer bindStatus; // 产权人绑定状态:0未绑定 1绑定

    @Basic
    @Column(name = "decorate_type", nullable = true)
    private Integer decorateType; // 装修类型：0毛坯 1简装 2精装(带家具） 3豪装(带家具)

    @Basic
    @Column(name = "match_status", nullable = true)
    private Integer matchStatus; // 配租状态：0未配租 1可配租 2已配租

    @Basic
    @Column(name = "lease_status", nullable = true)
    private Integer leaseStatus; // 出租状态：0未出租 1已出租

    @Basic
    @Column(name = "contract_status", nullable = true)
    private Integer contractStatus; // 合同状态：0未签订 1已签订

    @Basic
    @Column(name = "payment_status", nullable = true)
    private Integer paymentStatus; // 缴费状态：0未缴费 1已缴费

    @Basic
    @Column(name = "record_status", nullable = true)
    private Integer recordStatus; // 备案状态：0未备案 1已备案

    @Basic
    @Column(name = "pwd_lock_status", nullable = true)
    private Integer pwdLockStatus; // 密码锁授权：0未授权 1已授权 4已冻结

    @Basic
    @Column(name = "check_status", nullable = true)
    private Integer checkStatus; // 核查状态：0未核查、1已核查

    @Basic
    @Column(name = "record_change_status", nullable = true)
    private Integer recordChangeStatus; // 备案信息变更状态：0未变更 1已完成 2变更中

    @Basic
    @Column(name = "renewal_status", nullable = true)
    private Integer renewalStatus; // 续签状态：0未续签 1已完成 2续签中

    @Basic
    @Column(name = "match_type", nullable = true)
    private Integer matchType; // 配租方式：1单承租人(整租)  2多承租人（合租）  默认为空

    @Basic
    @Column(name = "apply_code", nullable = true)
    private String applyCode; // 配租批次号

    @Basic
    @Column(name = "contract_number", nullable = true)
    private String contractNumber; // 合同编码

    @Basic
    @Column(name = "operation_id", nullable = true)
    private String operationId; // 录入人id

    @Basic
    @Column(name = "create_time", nullable = true)
    private Date createTime; // 创建时间

    @Basic
    @Column(name = "owner_type", nullable = true)
    private Integer ownerType; // 产权归属类型：1产权单位 2个人

    /*
     * 业主
     */
    @Basic
    @Column(name = "owner_name", nullable = true)
    private String ownerName;

    /*
     * 产权所有人电话
     */
    @Basic
    @Column(name = "owner_mobile", nullable = true)
    private String ownerMobile;

    /*
     * 产权所有人id ：根据电话号码匹配用户
     */
    @Basic
    @Column(name = "owner_user_id", nullable = true)
    private String ownerUserId;

    /*
     * 收费开始日期
     */
    @Basic
    @Column(name = "start_time", nullable = true)
    private Date startTime;

    /*
     * 水表号
     */
    @Basic
    @Column(name = "water_meter", nullable = true)
    private String waterMeter;

    /*
     * 电表号
     */
    @Basic
    @Column(name = "electric_meter", nullable = true)
    private String electricMeter;

    /*
     * 燃气表号
     */
    @Basic
    @Column(name = "gas_meter", nullable = true)
    private String gasMeter;

    /*
     * 状态：1正常 2已删除
     */
    @Basic
    @Column(name = "status", nullable = true)
    private Integer status;

    /*
     * 单位承租人Id
     */
    @Basic
    @Column(name = "unit_lessee_id", nullable = true)
    private Long unitLesseeId;

    /*
     * 合租房屋Id
     */
    @Basic
    @Column(name = "housemate_id", nullable = true)
    private String housemateId;

    @Transient
    List<CommunityHouseUser> communityHouseUsers;
    @Transient
    private String housePath;


    /**
     * 统一信用代码
     */
    @Basic
    @Column(name = "social_credit_number", nullable = true)
    private String socialCreditNumber;

}
